﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpDwgDxfInterface.h"
#include "ElementId.h"

namespace gcmp
{
    class IGraphicsNodePath;
    class IGraphicsStyleData;
    class IGraphicsElementShape;
    class ILinkElementProxy;

    /// \brief 颜色显示方式
    enum class ColorMethod : int32_t
    {
        ByLayer = 0, ///< 颜色随层
        ByBlock = 1, ///< 颜色随块
        ByColor = 2  ///< 颜色值
    };

    /// \brief 线宽 对应cad导出中的LineWeight，单位一致
    enum class LineWidth : int32_t
    {
        LineWidthByLayer = -1,
        LineWidthByBlock = -2,
        LineWidthByLwDefault = -3,
        LineWidth000 = 0,
        LineWidth005 = 5,
        LineWidth009 = 9,
        LineWidth013 = 13,
        LineWidth015 = 15,
        LineWidth018 = 18,
        LineWidth020 = 20,
        LineWidth025 = 25,
        LineWidth030 = 30,
        LineWidth035 = 35,
        LineWidth040 = 40,
        LineWidth050 = 50,
        LineWidth053 = 53,
        LineWidth060 = 60,
        LineWidth070 = 70,
        LineWidth080 = 80,
        LineWidth090 = 90,
        LineWidth100 = 100,
        LineWidth106 = 106,
        LineWidth120 = 120,
        LineWidth140 = 140,
        LineWidth158 = 158,
        LineWidth200 = 200,
        LineWidth211 = 211
    };

    /// \brief GNode
    struct GCMP_DWG_DXF_INTERFACE_EXPORT  StyleStrategy
    {
        bool colorByLayer;  ///< 颜色是否随层，1-ByLayer，0-ByStyle
        bool lineTypeByLayer;   ///< 线型是否随层，1-ByLayer，0-ByStyle
        bool lineWidthByLayer;   ///< 线宽是否随层，1-ByLayer，0-ByStyle
        LineWidth lineWidth;   ///< 线宽
        StyleStrategy();
        StyleStrategy(bool colorByLayer, bool lineTypeByLayer, bool lineWidthByLayer);
    };

    /// \brief 构件对象获取图层信息参数
    struct GCMP_DWG_DXF_INTERFACE_EXPORT ElementParam
    {
        ElementParam();
        ElementParam(const ElementId& id, const IGraphicsElementShape* pGrep);
        ElementId elementId;///< Element对象的ElementId
        const IGraphicsElementShape* pGraphicsElementShape;///< Element对象的Grep
    };

    /// \brief GNode节点获取图层信息参数
    struct GCMP_DWG_DXF_INTERFACE_EXPORT GNodeParam
    {
        GNodeParam();
        ElementId elementId;///< GNode对应的ElementId
        const IGraphicsNodePath* pGNodePath;///< GNode节点Path
        const IGraphicsStyleData* pGraphicsStyleData;///< GNode节点的样式信息
        const ILinkElementProxy* pLinkElementProxy;///< 链接模型GNode节点对应的ElementProxy对象
    };

    /// \brief 体的面对应的投影区域
    struct GCMP_DWG_DXF_INTERFACE_EXPORT BodyFaceProjectRegionParam : public GNodeParam
    {
        BodyFaceProjectRegionParam();
        bool isSection; ///< 是否剖切面
    }; 

    /// \brief 体的边对应的投影线
    struct GCMP_DWG_DXF_INTERFACE_EXPORT BodyEdgeProjectCurveParam : public GNodeParam
    {
        BodyEdgeProjectCurveParam();
        bool isSection; ///< 是否剖面线
        bool isContour; ///< 是否轮廓线
        bool visible; ///< 是否可见,隐藏线
    };

    /// \brief 二维填充参数
    struct GCMP_DWG_DXF_INTERFACE_EXPORT FillRegionParam
    {
        FillRegionParam();
        std::wstring patternName; ///< 填充花纹
        double angle; ///< 填充角度
        double scale;///< 填充比例
    };
}


